<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="pageLayout">
	
		<ui:decorate template="/layout/boxed.xhtml">
			<ui:param name="title" value="#{messages['playlists.my.title']}" />
			<ui:param name="toplevel" value="true" />
			<ui:param name="bordered" value="true" />
			
			<a4j:outputPanel id="myContentsPanel">
				<a4j:form id="myContentsForm">
					<div align="right">
						<a4j:commandButton action="#{myplaylists.addPublicPlaylist()}" reRender="myContentsPanel"
								value="#{messages['playlists.my.addPublicPlaylist']}" disabled="true"/>
						<a4j:commandButton action="#{myplaylists.addMyPlaylist()}" reRender="myContentsPanel"
								value="#{messages['playlists.my.addMyPlaylist']}"/>
						<h:commandButton action="#{myplaylists.generateAllPlayList()}" target="_blank" value="#{messages['generateAllPlayList']}"/>
					</div>		
					<div>
						<h:dataTable 
							id="contentsList"
							var="item"
							value="#{myplaylists.list}"
							rowClasses="odd,even">
							
							<h:column>
								<f:facet name="header">
									<h:outputText value="#{messages['playlists.my.name']}" />
								</f:facet>
									<a4j:commandLink action="#{myplaylists.editPlaylist(item.id)}">
										<h:outputText value="#{item.name}" />
									</a4j:commandLink>
							</h:column>
							<h:column>
								<f:facet name="header">
									<h:outputText value="#{messages['playlists.my.description']}" />
								</f:facet>
									<h:outputText value="#{item.description}" />
							</h:column>
						</h:dataTable>
					</div>
				</a4j:form>
			</a4j:outputPanel>
			
		</ui:decorate>

	</ui:define>

</ui:composition>